﻿using EA.BA;
using EA.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace EAClient
{
    public partial class SearchProduct : WebPage
    {
        override
        protected void Load(object sender, EventArgs e)
        {
            int page = Request["page"] == null ? 1 : Convert.ToInt32(Request["page"]);
            String keyword = Request["keyword"];
            ProductBA productBA = new ProductBA();
            int totalResult = productBA.GetTotalAllProductByKeyword(keyword);
            
            List<ProductTO> listProduct = productBA.GetAllProductByKeyword(page,keyword);
            Attributes.Add("listProduct", listProduct);
            Attributes.Add("totalResult", totalResult);
            Attributes.Add("page", page);
        }
    }
}